package jvm;

import java.util.HashMap;
import java.util.Map;

class Point{
    @Override//对象在GC之前会执行此方法
    protected void finalize() throws Throwable {
        System.out.println("finalize");
    }
}
//-XX:+PrintGC
public class GCTest01 {
    public static void main(String[] args) {
        //Map<String,Object> beanPool=new HashMap<>();
        Point p1=new Point();
        //beanPool.put("key1",p1);
        p1=null;
        System.gc();
    }
}
